<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

<ui:composition template="templates2/layout.xhtml">
	<ui:define name="content">
		<h:form>
			<article class="module width_full"> <header>
			<h3>Search Interest Rate</h3>
			</header>
			<div class="module_content">
				<fieldset style="width: 32%; float: left; margin-right: 1.5%;">
					<label>By Period Type </label><span style="color: red"><h:message
							for="accNum"></h:message></span>
					<h:inputText id="accNum"
						value="#{savingAccManagedBean.accountNumber}"
						converter="javax.faces.Long"
						converterMessage="Invalid account number" style="width: 90%;"
						validatorMessage="Account number must have 12 digits">
						<f:validateLength minimum="12" maximum="12"></f:validateLength>
					</h:inputText>
				</fieldset>
				<fieldset style="width: 32%; float: left;margin-right: 1.5%;">
					<label>By Currency </label><span style="color: red"><h:message
							for="idNum"></h:message></span>
					<h:inputText id="idNum"
						value="#{savingAccManagedBean.idCardNumber}"
						converter="javax.faces.Long"
						converterMessage="Invalid ID card number" style="width: 90%;"
						validatorMessage="ID Card number must have 9 digits">
						<f:validateLength minimum="9"></f:validateLength>
					</h:inputText>
				</fieldset>
				<fieldset style="width: 32%; float: left;">
					<label>By Time </label><span style="color: red"><h:message
							for="idNum"></h:message></span>
					<h:inputText 
						value="#{savingAccManagedBean.idCardNumber}"
						converter="javax.faces.Long"
						converterMessage="Invalid ID card number" style="width: 90%;"
						validatorMessage="ID Card number must have 9 digits">
						<f:validateLength minimum="9"></f:validateLength>
					</h:inputText>
				</fieldset>

				<div class="submit_link">
					<h:commandButton value="Search"
						action="#{savingAccManagedBean.search}" />
					<h:commandButton value="Reset">
						<f:ajax render="form" listener="#{savingAccManagedBean.refresh}"></f:ajax>
					</h:commandButton>
				</div>
				<div class="clear"></div>
			</div>
			</article>
			<article class="module width_full"> <header>
			<h3>Interest Rate</h3>
			</header>
			<div class="module_content">
				<fieldset style="width: 100%;">
					<h:dataTable styleClass="tablesorter"
						value="#{savingInterestManagedBean.savingInterestRates}" first=""
						var="i" rows="">
						<h:column>
							<f:facet name="header">Interest Rate ID</f:facet>
							#{i.interestRateID}
						</h:column>
						<h:column>
							<f:facet name="header">Rate</f:facet>
							#{i.rate}
						</h:column>
						<h:column>
							<f:facet name="header">Currency</f:facet>
							#{i.currency.currency}
						</h:column>
						<h:column>
							<f:facet name="header">Period Type</f:facet>
							#{i.periodType.savingPeriod} #{i.periodType.unit}
							<c:if test="${i.periodType.savingPeriod gt 1}">s</c:if>
						</h:column>
						<h:column>
							<f:facet name="header">Created Date</f:facet>
							#{i.createdDate}
						</h:column>
						<!-- <h:column>
							<f:facet name="header">Action</f:facet>
							<h:commandLink>
								<f:param></f:param>
								Details</h:commandLink>
						</h:column> -->
					</h:dataTable>
				</fieldset>
			</div>
			<footer>
			<div class="submit_link">
				<select>
					<option>1-5</option>
					<option>6-10</option>
				</select>
			</div>
			</footer> </article>
		</h:form>
	</ui:define>
	<ui:define name="sidebar">
		<ui:include src="/templates2/sidebar.xhtml">
			<ui:param name="current" value="home"></ui:param>
		</ui:include>
	</ui:define>
</ui:composition>
</html>